<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="packaging.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'index.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="css/indexcss.css">
  

	</head>

	<body>
	
		<%
			Map<String, CartBean> car = (Map<String, CartBean>) session.getAttribute("car");		
			int numb = 0;
			if (car != null) {
				for (String key : car.keySet()) {
					CartBean cb = car.get(key);
					int num = cb.getNum();
					numb = numb + num;

				}

			}
		%>
		<%
			session.setAttribute("numb", numb);
		%>
	
	
	
	
	
	
	<div id="s2">
			<table width="950px" border="0">
				<tr>
					<td width="172" rowspan="2">
						<img src="img/logo.png" width="159" height="85px" />
					</td>
					<td width="395" height="76">
						<p>
							您好!
							<%
						if (session.getAttribute("USER") == null) {
					%>
							<a href="lp.jsp">请登录</a>
												<%
						} else {
					%>

					<a href="buy.jsp"> <%
 	out.print(session.getAttribute("USER")); }
 	 
 	if(session.getAttribute("numb") == null)
 	{
 	out.print("");
 	 } 
 	else{
 	out.print("你的购物车共有"+session.getAttribute("numb")+"件商品");
 	
 	}
 	

 %>
					</a>
						</p>
						<p>
							<span style="color: #FF9966; font-size: 15px"> </span><span
								style="color: #FF9966; font-size: 15px"> 全场购物免配送费! </span>
						</p>
					</td>
					<td width="369" style="color: #FF9966; font-size: 15px">
						<form id="form1" name="form1" method="post" action="check.jsp">

							<input type="text" name="con" id="" size="18"  />


							<input type="submit" name="button" id="button" value="搜索"
								style="background: #F6F6F6;" />

						</form>
					</td>
				</tr>
				<tr>
					<td height="15" style="color: #004B91; font-weight: bold">
						我的START SHOES | 礼品卡
					</td>
					<td style="color: #004B91;">
						我的帐户 | 新手上路 | 帮助
					</td>
				</tr>
			</table>
			<ul style="background-image: url(img/title.jpg)">
				<li><a href="index.jsp">
					首页
					</a>
				</li>
				<li>
					品牌馆
				</li>
				<li>
					男鞋
				</li>
				<li>
					女鞋
				</li>

			</ul>
		</div>
			<div id="pl">
			<div id="pp1">
				<table width="200" height="503" border="0">
					<tr>
						<td height="25" colspan="2"
							style="border-bottom: 1px #DECEA5 solid">
							　　运动休闲鞋
						</td>
					</tr>
					<tr>
						<td width="82" height="25"
							style="border-bottom: #DECEA5 solid 1px">
							<img src="img/naike.jpg" width="81" height="25" />
						</td>
						<td width="108">
							耐克
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/nike.jpg" width="81" height="24" />
						</td>
						<td>
							耐克360
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/peak.jpg" width="81" height="25" />
						</td>
						<td>
							匹克
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/kapa.jpg" width="81" height="25" />
						</td>
						<td>
							卡帕
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/biaoma.jpg" width="81" height="25" />
						</td>
						<td>
							彪马
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/erke.jpg" width="81" height="25" />
						</td>
						<td>
							鸿星尔克
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/huili.jpg" width="81" height="25" />
						</td>
						<td>
							回力
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/tebu.jpg" width="81" height="25" />
						</td>
						<td>
							特步
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/shuangxing.jpg" width="81" height="29" />
						</td>
						<td>
							双星
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/361.jpg" width="81" height="25" />
						</td>
						<td>
							361
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/adidas.jpg" width="81" height="25" />
						</td>
						<td>
							阿迪达斯
						</td>
					</tr>
					<tr>
						<td style="border-bottom: #DECEA5 solid 1px">
							<img src="img/kuangwei.jpg" width="81" height="25" />
						</td>
						<td>
							匡威
						</td>
					</tr>
					<tr>
						<td height="25px">
							<img src="img/lining.jpg" width="81" height="25" />
						</td>
						<td>
							李宁
						</td>
					</tr>
				</table>
			</div>


			<div id="pp2">
			<div id="ppp1">
			<div id="ppp3">

			  <script type="text/javascript">
imgUrl1 = "images/01.jpg";
imgtext1 = "李宁跨界合作限量鞋"
imgLink1 = escape("http://localhost:8080/llp/");
imgUrl2 = "images/02.jpg";
imgtext2 = "双星新年开门红"
imgLink2 = escape("http://localhost:8080/llp/");
imgUrl3 = "images/03.jpg";
imgtext3 = "李宁最新篮球鞋系列"
imgLink3 = escape("http://localhost:8080/llp/");
imgUrl4 = "images/04.jpg";
imgtext4 = "红蜻蜓直降260元"
imgLink4 = escape("http://localhost:8080/llp/");
imgUrl5 = "images/05.jpg";
imgtext5 = "匹克恭贺新春120元起"
imgLink5 = escape("http://localhost:8080/llp/");

var focus_width = 550
var focus_height = 250
var text_height = 18
var swf_height = focus_height + text_height

var pics = imgUrl1 + "|" + imgUrl2 + "|" + imgUrl3 + "|" + imgUrl4 + "|"
		+ imgUrl5
var links = imgLink1 + "|" + imgLink2 + "|" + imgLink3 + "|" + imgLink4 + "|"
		+ imgLink5
var texts = imgtext1 + "|" + imgtext2 + "|" + imgtext3 + "|" + imgtext4 + "|"
		+ imgtext5

document
		.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'
				+ focus_width + '" height="' + swf_height + '">');
document
		.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/focus1.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
document
		.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document
		.write('<param name="FlashVars" value="pics=' + pics + '&links='
				+ links + '&texts=' + texts + '&borderwidth=' + focus_width
				+ '&borderheight=' + focus_height + '&textheight='
				+ text_height + '">');
document.write('</object>');
</script>
			  </div>
			<div id="ppp4">
			<table width="192" height="235" >
  <tr>
    <td height="21"><span class="STYLE1">　活动公告</span></td>
  </tr>
  <tr>
    <td height="21"><u><span class="STYLE2">[公告] 部分地区配送延迟公告</span></u></td>
  </tr>
  <tr>
    <td height="21"><u><span class="STYLE2">[活动] 300万优惠券一元疯抢！
    </span></u></td>
  </tr>
  <tr>
    <td height="21"><u><span class="STYLE2">[活动] 在线支付 获最高50元优惠券
    </span></u></td>
  </tr>
  <tr>
    <td height="21"><u><span class="STYLE2">[公告]“月黑风高”秒鞋震撼持续
    </span></u></td>
  </tr>
  <tr>
    <td height="21"><u><span class="STYLE2">[活动] 抢年货活动开始啦！
    </span></u></td>
  </tr>
   <tr>
    <td height="21"><u><span class="STYLE2">[活动] 品牌鞋年终回馈开始啦！
    </span></u></td>
  </tr>
</table>	
			</div>
			
			
			
			</div>
			<div id="ppp2">
            <table width="742" height="225" border="0" style="margin-top:0px; padding-top:0px">
    <tr>
      <td width="44" height="222" rowspan="4"  id="pppp"><p align="center">运</p>
      <p align="center">动</p>
      <p align="center">鞋</p></td>
      <td width="66"><div align="center"><strong> 功能

</strong></div></td>
      <td width="624"><span class=" STYLE1">训练鞋 户外运动鞋 室内运动鞋 

羽毛球鞋 跑步鞋 明星篮球鞋
      足球鞋 赛车鞋 网球鞋
      
      </span></td>
    </tr>
    <tr>
      <td><div align="center"><strong>科技</strong></div></td>
      <td><span class=" STYLE1">AIR气垫 TS团队篮球鞋 ZOOM气垫 全掌气垫 

adiwear90 ClimaCool</span></td>
    </tr>
    <tr>
      <td><div align="center"><strong>生活</strong></div></td>
      <td><span class="STYLE1">潮流板鞋 复古休闲鞋 热销帆布鞋 凉鞋 拖鞋 

硫化鞋 90后运动鞋 经典　怀旧鞋
      户外鞋
      </span></td>
    </tr>
    <tr>
      <td><div align="center"><strong>潮流</strong></div></td>
      <td><span class="STYLE1">三叶草 Vans板鞋 AF1板鞋 DUNK板鞋 李宁复

古鞋 中高帮潮鞋 airmax90  airmax90</span></td>
    </tr>
  </table>

			</div>
			
			
			


			</div>
		</div>
		
<div id="pp3">

			<%
				check indexs = new check();
				String sql = "select * from imp";
				ResultSet rs = indexs.indexs(sql);
				String page1 = (String) request.getParameter("page");
				if (page1 == null) {
					page1 = "0";
				}
				int pagesize = 10;//记录每页显示的条数
				rs.last();//定位最后那条记录
				int recordCount = rs.getRow();//取得最后一行号数
				int maxPage = 0;//看看有多少页
				maxPage = (recordCount % pagesize == 0) ? (recordCount / pagesize)
						: (recordCount / pagesize + 1);
				int currentPage = Integer.parseInt(page1);
				if (currentPage < 1) {
					currentPage = 1;
				} else {
					if (currentPage > maxPage) {
						currentPage = maxPage;
					}
				}
				rs.absolute((currentPage - 1) * pagesize + 1);
				for (int i = 1; i <= pagesize; i++) {
			%>
			<div id="pp4">
			
				<a href="see.jsp?id=<%=rs.getObject("p_id") %>"><img src="<%=rs.getString("p_img")%>" width="160px"; height="107px"/></a>
				
				<p><a href="see.jsp?id=<%=rs.getObject("p_id") %>"><%=rs.getString("p_name") %><br>特价<%=rs.getString("p_newprice")%> 原价：<%=rs.getString("p_oldprice")%></a></p>
				
				 
				
			
			</div>
			<%
				if (!rs.next()) {
						break;
					}
				}
			%>
			<p
				style="clear: both; margin-top: 0px; padding-top: 0px; padding-left: 580px">

				当前页数：<%=currentPage%>/<%=maxPage%>

				<%
					if (currentPage >= 1) {
				%>
				<a href="index.jsp?page=1">首页</a>
				<a href="index.jsp?page=<%=currentPage - 1%>"> 上一页</a>
				<%
					}
					if (currentPage <= maxPage) {
				%>
				<a href="index.jsp?page=<%=currentPage + 1%>"> 下一页</a>
				<a href="index.jsp?page=<%=maxPage%>"> 尾页</a>
				<%
					}
				%>
				
			</p>

		</div>
		








	</body>
</html>
